<div class="modal-header">
	<a class="close" data-dismiss="modal">&times;</a>
	<h4>Cetak SPD</h4>
</div>
 
<div class="modal-body">
			Karyawan Penandatangan &nbsp;&nbsp;&nbsp;&nbsp;
			<?php 
				echo CHtml::hiddenField('id_karyawan',''); 
				echo CHtml::textField('namakaryawan', '', array('class'=>'span5','readonly'=>true));
				$this->widget('bootstrap.widgets.TbLabel', array(
					'type'=>'important', // 'success', 'warning', 'important', 'info' or 'inverse'
					'label'=>'F4 Search',
				));
			?>
</div>
 
<div class="modal-footer">
	<?php $this->widget('bootstrap.widgets.TbButton', array(
		'type'=>'primary',
		'label'=>'Cetak',
		// 'url'=>Yii::app()->controller->createUrl("kegiatan/cetakSpd", array("id" => $id_kegiatan)),
		'htmlOptions'=>array(
				// 'data-dismiss'=>'modal',
				'target' => '_blank',
				'id' => 'ctkSpd'
		),
	)); ?>
	<?php $this->widget('bootstrap.widgets.TbButton', array(
		'label'=>'Close',
		'url'=>'#',
		'htmlOptions'=>array('data-dismiss'=>'modal'),
	)); ?>
</div>
<?php $this->beginWidget('bootstrap.widgets.TbModal', array(
			'id'=>'winKary',
			'htmlOptions'=>array('style'=>'width:800px'),
)); ?>
<?php $this->endWidget(); ?>
<script>
	$("#namakaryawan").keypress(function(e) {
		if (e.keyCode == 115){
			$('#winKary').load(baseurl+"/index.php/Karyawan/popup");
			$("#winKary").modal('show');
		}
	});
	function chKary(id,nama){
		$("#id_karyawan").val(id);
		$("#namakaryawan").val(nama);
		$('#winKary').modal('hide');
	}
	$("#ctkSpd").click(function(){
		if($('#id_karyawan').val()==''||$('#namakaryawan').val()==''){
			alert('Anda harus mengisi Karyawan Dahulu !');
		}else{
			window.open(baseurl+'/index.php/kegiatan/cetakSpd/id/<?php echo $id_kegiatan; ?>/send_id_kary/'+$("#id_karyawan").val(), '_blank');
			$('#winCetak').modal('hide');
		}
	});
</script>